package com.walk.zworld.mvvm.vm

import androidx.lifecycle.LiveData
import com.walk.zworld.mvvm.repository.SystemRepository
import com.base.lib.httpUtils.KnowledgeTreeBody
import com.base.lib.base.mvvm.viewmodel.BaseRefreshViewModel

class KnowledgeViewModel : BaseRefreshViewModel<KnowledgeTreeBody>()  {

    private val repository = SystemRepository()

    fun getKnowledgeTree(): LiveData<List<KnowledgeTreeBody>> {
        launchUI {
            val result = repository.getKnowledgeTree()
            mData.value = result.data
        }
        return mData
    }

    override fun refreshData(params: Any?) {
        getKnowledgeTree()
    }

    override fun loadMore(params: Any?) {
//        getKnowledgeTree()
    }
}